from models import Enterprise
from utils import auth
from utils import utils


class EnterpriseService:

    def __init__(self):
        pass

    @classmethod
    async def insert(cls, mobile: str, user: str):
        uid = utils.get_uid()
        data_dict = {
            "create_user": user,
            "update_user": user,
            "tenant_id":"0",
            "uid": uid,
            "name": mobile,
            "mobile": mobile,
        }

        await Enterprise(**data_dict).save()
        return uid

